﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class CityMap : ClassMap<City>
    {

        public CityMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblCity);
            LazyLoad();

            Id(x => x.Code).GeneratedBy.Assigned().Column("CITYID");
            References(x => x.Country).Column("COUNTRYID");

            Map(x => x.Name).Column("CITYNAME").Not.Nullable().Length(30);
        }
    }
}
